/*
 * ears.h
 *
 *  Created on: Nov 26, 2012
 *      Author: michiel
 */

#ifndef EARS_EMOTION_H_
#define EARS_EMOTION_H_

#include "emotion_handler.h"
#include "comm/ears_msg.h"

class EarsHandler : public EmotionHandler {
	private:
		ros::Publisher	_ears_pub;
	protected:
		comm::ears			ears_state_;

		/**
		 * Publish ears state (emotion).
		 */
		void publish();
	public:
		EarsHandler();
		~EarsHandler();

		void init();
		void spin();

		/**
		 * Set the state of the ears according to the emotion.
		 */
		void processEmotion();

		/**
		 * Set the left ear state.
		 */
		void setLEarState(int state);

		/**
		 * Set the right ear state.
		 */
		void setREarState(int state);

		/**
		 * Set the state of both the ears.
		 */
		void setEarsState(int state);

		/**
		 * Set left ear angle (used for rviz).
		 */
		void setLEarAngle(float angle);

		/**
		 * Set right ear angle (used for rviz).
		 */
		void setREarAngle(float angle);

		/**
		 * Set the angle of both the ears (used for rviz).
		 */
		void setEarsAngle(float angle);
};

#endif /* EARS_EMOTION_H_ */
